package com.example.codereadingspringsecurity;

import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component;

/**
 * @author zhoushen
 * @since 2021/3/12
 */

@Component
//@Lazy
public class Conn implements InitializingBean, DisposableBean {

    public Conn() {
        int i = 1;
    }

    private String name = "comm";

    public String getName() {
        return name;
    }

    @Override
    public void afterPropertiesSet() throws Exception {
        int i =2;
    }

    @Override
    public void destroy() throws Exception {
        System.out.println("------------destory");
        int i = 3;
    }
}
